/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ivanbiz.ruang;

import java.util.List;

/**
 *
 * @author User
 */
public class RuangServiceImpl implements RuangService{
    private RuangDAO ruangDAO;
  
    public void setRuangDAO(RuangDAO ruangDAO) {
        this.ruangDAO = ruangDAO;
    }
    
    public void saveRuang(Ruang ruang) throws Exception {
        this.ruangDAO.save(ruang);
    }

    public void deleteRuang(Ruang ruang) throws Exception {
        this.ruangDAO.delete(ruang);
    }

    public void updateRuang(Ruang ruang) throws Exception {
        this.ruangDAO.update(ruang);
    }

    public List loadAll() throws Exception {
        return this.ruangDAO.getAll(Ruang.class);
    } 

    public Ruang loadById(long id) throws Exception {
        return (Ruang)this.ruangDAO.load(Ruang.class, id);
    }

    public boolean cekIsEmptyKode(String kode) throws Exception {
        return this.ruangDAO.cekIsEmptyKode(kode);
    }
    
}
